package com.isoftstone.util;

import android.content.Context;

/**
 * Created by issuser on 2017/1/16.
 */

public class RUtil
{
    private Context context;
    public static RUtil instance;
    public RUtil(Context context)
    {
        this.context = context;
    }
    public int getLayout(String layoutName)
    {
        return this.context.getResources().getIdentifier(layoutName, "layout", context.getPackageName());
    }
    public int getString(String stringName)
    {
        return this.context.getResources().getIdentifier(stringName, "string", context.getPackageName());
    }
    public int getAnim(String animName)
    {
        return this.context.getResources().getIdentifier(animName, "anim", context.getPackageName());
    }
    public int getDrawable(String drawableName)
    {
        return this.context.getResources().getIdentifier(drawableName, "drawable", context.getPackageName());
    }
    public int getColor(String colorName)
    {
        return this.context.getResources().getIdentifier(colorName, "color", context.getPackageName());
    }
    public int getStyle(String styleName)
    {
        return this.context.getResources().getIdentifier(styleName, "style", context.getPackageName());
    }
    public int getId(String idName)
    {
        return this.context.getResources().getIdentifier(idName, "id", context.getPackageName());
    }
}
